
<template>
    <mr-page-view :style="{ width: 'auth', margin: '20px' }">
        <mr-table
            @change="handle"
            :data-source="data"
            :columns="columns"
            :rowKey="record => record.id"
        >
            <template :slot="`action`" slot-scope="text">
                <span>
                    <a-button
                        type="link"
                        @click="$router.push({ name: 'data_info' })"
                    >
                        详情
                    </a-button>
                    <a-divider type="vertical" />
                    <a-popconfirm
                        title="Are you sure？"
                        okText="Yes"
                        cancelText="No"
                        style="color: red"
                        @confirm="handleEdit(text)"
                    >
                        <a>删除</a>
                    </a-popconfirm>
                </span>
            </template>
        </mr-table>
    </mr-page-view>
</template>

<script>
const columns = [
    {
        title: '机构ID',
        key: 'id',
        dataIndex: 'id',
        scopedSlots: { customRender: 'id' }
    },
    {
        title: '机构全称',
        key: 'name',
        dataIndex: 'name',
        scopedSlots: { customRender: 'name' }
    },
    {
        title: '邀请时间',
        key: 'createTime',
        dataIndex: 'createTime',
        scopedSlots: { customRender: 'createTime' }
    },
    {
        title: '操作',
        key: 'action',
        scopedSlots: { customRender: 'action' }
    }
]

const d = {
    total: '18',
    list: [
        {
            id: '1241989057592954882',
            name: '链知识产权促进15196603251',
            abbreviation: '链知识产权促进15196603251简称',
            nature: null,
            type: null,
            authStatus: 2,
            showStatus: 1,
            inviteAgencyId: null,
            inviteAgencyType: 4,
            contactsOne: '企业联系人1',
            contactsOnePosition: '总经理',
            contactsOnePhone: '15196603251',
            contactsTwo: '企业联系人2',
            contactsTwoPosition: '副经理',
            contactsTwoPhone: '15196603251',
            commAddressProvince: '510000',
            commAddressCity: '510100',
            commAddressArea: '510105',
            organizationType: 6,
            businessAddress: '成龙路街道潘家沟村7组1号',
            contractSigningTime: 1584806400000,
            contractEndTime: 1852819200000,
            contractFile:
                '[{"name":"企业估值超过10亿元.jpg","url":"data/5F2401C06B094D33918B38EA6ECE2B9B.jpg"}]',
            createTime: '2020-03-23 15:24:01',
            updateTime: '2020-03-23 15:50:13',
            certificationTime: '2020-03-23 15:50:13'
        },
        {
            id: '1241988806635163649',
            name: '链知识产权15196603242全称',
            abbreviation: '链知识产权15196603242简称',
            nature: null,
            type: null,
            authStatus: 2,
            showStatus: 1,
            inviteAgencyId: null,
            inviteAgencyType: 4,
            contactsOne: '企业联系人1',
            contactsOnePosition: '经理',
            contactsOnePhone: '15196603242',
            contactsTwo: '企业联系人1',
            contactsTwoPosition: '经理',
            contactsTwoPhone: '15196603242',
            commAddressProvince: '310000',
            commAddressCity: '310100',
            commAddressArea: '310105',
            organizationType: 5,
            businessAddress: '上海市黄浦区重庆南路227号',
            contractSigningTime: 1584806400000,
            contractEndTime: 1887379200000,
            contractFile:
                '[{"name":"营业执照 (2).jpg","url":"data/6046A1820E934E7F813E98A1ECE48F72.jpg"}]',
            createTime: '2020-03-23 15:23:01',
            updateTime: '2020-03-23 15:30:02',
            certificationTime: '2020-03-23 15:30:02'
        },
        {
            id: '1241936096871321601',
            name: '知识产权处',
            abbreviation: '知产局',
            nature: null,
            type: null,
            authStatus: 1,
            showStatus: 1,
            inviteAgencyId: null,
            inviteAgencyType: 4,
            contactsOne: '张三',
            contactsOnePosition: 'xxx',
            contactsOnePhone: '15566667777',
            contactsTwo: '李二',
            contactsTwoPosition: 'ss',
            contactsTwoPhone: '16677778888',
            commAddressProvince: '510000',
            commAddressCity: '510100',
            commAddressArea: '510104',
            organizationType: 5,
            businessAddress: '申贷申贷所',
            contractSigningTime: 1583078400000,
            contractEndTime: 1583164800000,
            contractFile:
                '[{"name":"著作权.jpg","url":"data/F84A00CC5D1240EFA377A91383E7C45E.jpg"}]',
            createTime: '2020-03-23 11:53:34',
            updateTime: '2020-03-23 12:02:00',
            certificationTime: null
        },
        {
            id: '1240947843397586945',
            name: '测试知识产权局区块链',
            abbreviation: '简称',
            nature: null,
            type: null,
            authStatus: 1,
            showStatus: 1,
            inviteAgencyId: null,
            inviteAgencyType: 4,
            contactsOne: '据了解',
            contactsOnePosition: null,
            contactsOnePhone: '13333333332',
            contactsTwo: '',
            contactsTwoPosition: null,
            contactsTwoPhone: '',
            commAddressProvince: null,
            commAddressCity: null,
            commAddressArea: null,
            organizationType: 5,
            businessAddress: null,
            contractSigningTime: 1584703860000,
            contractEndTime: 1584703860000,
            contractFile: null,
            createTime: '2020-03-20 18:26:36',
            updateTime: '2020-03-20 19:31:00',
            certificationTime: null
        },
        {
            id: '1237941397852524546',
            name: '知识产权促进中心0312',
            abbreviation: '知识产权促进中心0312简称',
            nature: null,
            type: null,
            authStatus: 3,
            showStatus: 1,
            inviteAgencyId: null,
            inviteAgencyType: 4,
            contactsOne: '企业联系人1',
            contactsOnePosition: '总经理',
            contactsOnePhone: '15196603241',
            contactsTwo: '企业联系人2',
            contactsTwoPosition: '项目经理',
            contactsTwoPhone: '15196603241',
            commAddressProvince: '510000',
            commAddressCity: '510100',
            commAddressArea: '510104',
            organizationType: 6,
            businessAddress: ' 四川省成都市武侯区航空路6号',
            contractSigningTime: 1583078400000,
            contractEndTime: 1783526400000,
            contractFile:
                '[{"name":"营业执照 (2).jpg","url":"data/699C55AD8D8C4BABB352D4AF61F9CF21.jpg"}]',
            createTime: '2020-03-12 11:20:04',
            updateTime: '2020-03-12 11:24:50',
            certificationTime: '2020-03-12 11:24:50'
        },
        {
            id: '1235834374922964993',
            name: '邀请知识产权促进中心',
            abbreviation: '邀请知识产权促进中心简称',
            nature: null,
            type: null,
            authStatus: 2,
            showStatus: 1,
            inviteAgencyId: null,
            inviteAgencyType: 4,
            contactsOne: '邀请知识产权促进中心企业联系人1',
            contactsOnePosition: 'CEO',
            contactsOnePhone: '15196603250',
            contactsTwo: '邀请知识产权促进中心企业联系人2',
            contactsTwoPosition: 'CEO2',
            contactsTwoPhone: '15196603250',
            commAddressProvince: '510000',
            commAddressCity: '510100',
            commAddressArea: '510104',
            organizationType: 6,
            businessAddress: '成都市武侯区万寿桥路116号',
            contractSigningTime: 1583482293000,
            contractEndTime: 1749484800000,
            contractFile:
                '[{"name":"ea0d428f59c02e2898280ce90249c849.png","url":"data/270C270331A946A0ADF6950FBCFE4CC5.png"}]',
            createTime: '2020-03-06 15:47:30',
            updateTime: '2020-03-06 16:24:44',
            certificationTime: '2020-03-06 16:24:44'
        },
        {
            id: '1235834185701134337',
            name: '邀请知识产权局',
            abbreviation: '邀请知识产权局简称',
            nature: null,
            type: null,
            authStatus: 2,
            showStatus: 1,
            inviteAgencyId: null,
            inviteAgencyType: 4,
            contactsOne: '邀请知识产权局企业联系人1',
            contactsOnePosition: '创投',
            contactsOnePhone: '15196603240',
            contactsTwo: '邀请知识产权局企业联系人2',
            contactsTwoPosition: 'coe',
            contactsTwoPhone: '15196603240',
            commAddressProvince: '510000',
            commAddressCity: '510100',
            commAddressArea: '510106',
            organizationType: 5,
            businessAddress: '成都市青羊区金沙遗址路2号',
            contractSigningTime: 1583078400000,
            contractEndTime: 1887465600000,
            contractFile:
                '[{"name":"营业执照.jpg","url":"data/17605F95A2BE403BA6ABB09E55FD7297.jpg"}]',
            createTime: '2020-03-06 15:46:45',
            updateTime: '2020-03-06 15:58:10',
            certificationTime: '2020-03-06 15:58:10'
        },
        {
            id: '1235521210373115905',
            name: 'tyq知识产权促进中心',
            abbreviation: 'asdfas',
            nature: null,
            type: null,
            authStatus: 2,
            showStatus: 1,
            inviteAgencyId: null,
            inviteAgencyType: 4,
            contactsOne: 'tyq',
            contactsOnePosition: 'asdfas',
            contactsOnePhone: '13411111111',
            contactsTwo: '1231231',
            contactsTwoPosition: 'asdfasdf',
            contactsTwoPhone: '13222222222',
            commAddressProvince: '120000',
            commAddressCity: '120100',
            commAddressArea: '120102',
            organizationType: 6,
            businessAddress: 'asdfas',
            contractSigningTime: 1584374400000,
            contractEndTime: 1583769600000,
            contractFile:
                '[{"name":"1P4020F057-35O-0.jpg","url":"data/D67F947F33334EBE80A25F3E57E17C09.jpg"}]',
            createTime: '2020-03-05 19:03:06',
            updateTime: '2020-03-11 16:40:59',
            certificationTime: '2020-03-11 16:40:59'
        },
        {
            id: '1235518024904085505',
            name: 'tyq知识产权局',
            abbreviation: 'asdfas',
            nature: null,
            type: null,
            authStatus: 2,
            showStatus: 1,
            inviteAgencyId: null,
            inviteAgencyType: 4,
            contactsOne: 'tyq',
            contactsOnePosition: '12312',
            contactsOnePhone: '13311111111',
            contactsTwo: '12312',
            contactsTwoPosition: '12312',
            contactsTwoPhone: '12312',
            commAddressProvince: '150000',
            commAddressCity: '150400',
            commAddressArea: '150404',
            organizationType: 5,
            businessAddress: '内蒙古自治区赤峰市松山区1231231',
            contractSigningTime: 1583405641000,
            contractEndTime: 1583405641000,
            contractFile:
                '[{"name":"1P4020F057-35O-0.jpg","url":"data/C50FB9C941324FE5B2E263377B76C937.jpg"}]',
            createTime: '2020-03-05 18:50:27',
            updateTime: '2020-03-06 16:10:51',
            certificationTime: '2020-03-06 16:10:51'
        },
        {
            id: '1235162941527982081',
            name: '新增1',
            abbreviation: null,
            nature: null,
            type: null,
            authStatus: 2,
            showStatus: 1,
            inviteAgencyId: null,
            inviteAgencyType: 4,
            contactsOne: '121',
            contactsOnePosition: null,
            contactsOnePhone: '13365656456',
            contactsTwo: '122',
            contactsTwoPosition: null,
            contactsTwoPhone: '13246487821',
            commAddressProvince: null,
            commAddressCity: null,
            commAddressArea: null,
            organizationType: 5,
            businessAddress: null,
            contractSigningTime: 1583483665000,
            contractEndTime: 1583483665000,
            contractFile: null,
            createTime: '2020-03-04 19:19:28',
            updateTime: '2020-03-06 16:39:29',
            certificationTime: '2020-03-06 16:39:29'
        }
    ],
    pageNum: 1,
    pageSize: 10,
    size: 10,
    startRow: 0,
    endRow: 0,
    pages: 2,
    prePage: 0,
    nextPage: 0,
    isFirstPage: false,
    isLastPage: false,
    hasPreviousPage: false,
    hasNextPage: false,
    navigatePages: 0,
    navigatepageNums: null,
    navigateFirstPage: 0,
    navigateLastPage: 0,
    firstPage: 0,
    lastPage: 0
}

const d2 = {
    total: '18',
    list: [
        {
            id: '1235088119678697473',
            name: 'suo_type6',
            abbreviation: null,
            nature: null,
            type: null,
            authStatus: 1,
            showStatus: 1,
            inviteAgencyId: null,
            inviteAgencyType: 4,
            contactsOne: 'type6',
            contactsOnePosition: null,
            contactsOnePhone: '13553535353',
            contactsTwo: '',
            contactsTwoPosition: null,
            contactsTwoPhone: '',
            commAddressProvince: null,
            commAddressCity: null,
            commAddressArea: null,
            organizationType: 6,
            businessAddress: null,
            contractSigningTime: null,
            contractEndTime: null,
            contractFile: null,
            createTime: '2020-03-04 14:22:09',
            updateTime: '2020-03-04 14:22:09',
            certificationTime: null
        },
        {
            id: '1235087831672619009',
            name: 'suo_type5',
            abbreviation: null,
            nature: null,
            type: null,
            authStatus: 2,
            showStatus: 1,
            inviteAgencyId: null,
            inviteAgencyType: 4,
            contactsOne: 'type5',
            contactsOnePosition: null,
            contactsOnePhone: '13223232323',
            contactsTwo: '',
            contactsTwoPosition: null,
            contactsTwoPhone: '',
            commAddressProvince: null,
            commAddressCity: null,
            commAddressArea: null,
            organizationType: 5,
            businessAddress: null,
            contractSigningTime: 1583482107000,
            contractEndTime: 1583482107000,
            contractFile: null,
            createTime: '2020-03-04 14:21:01',
            updateTime: '2020-03-06 16:14:25',
            certificationTime: '2020-03-06 16:14:25'
        },
        {
            id: '1235031641190096897',
            name: '1111',
            abbreviation: null,
            nature: null,
            type: null,
            authStatus: 4,
            showStatus: 1,
            inviteAgencyId: null,
            inviteAgencyType: 4,
            contactsOne: 'suo_1',
            contactsOnePosition: null,
            contactsOnePhone: '13154545454',
            contactsTwo: '',
            contactsTwoPosition: null,
            contactsTwoPhone: '',
            commAddressProvince: null,
            commAddressCity: null,
            commAddressArea: null,
            organizationType: 5,
            businessAddress: null,
            contractSigningTime: 1583482106000,
            contractEndTime: 1583482106000,
            contractFile: null,
            createTime: '2020-03-04 10:37:44',
            updateTime: '2020-03-06 16:08:26',
            certificationTime: null
        },
        {
            id: '1233225359562932225',
            name: '11111',
            abbreviation: null,
            nature: null,
            type: null,
            authStatus: null,
            showStatus: 1,
            inviteAgencyId: null,
            inviteAgencyType: 4,
            contactsOne: 'suo',
            contactsOnePosition: null,
            contactsOnePhone: '13545469712',
            contactsTwo: '',
            contactsTwoPosition: null,
            contactsTwoPhone: '',
            commAddressProvince: null,
            commAddressCity: null,
            commAddressArea: null,
            organizationType: 6,
            businessAddress: null,
            contractSigningTime: 1583287990000,
            contractEndTime: 1583287990000,
            contractFile: null,
            createTime: '2020-02-28 11:00:13',
            updateTime: '2020-03-04 10:13:10',
            certificationTime: null
        },
        {
            id: '4',
            name: '测试_知识产权局23333',
            abbreviation: '222222',
            nature: '3',
            type: '39',
            authStatus: 4,
            showStatus: 1,
            inviteAgencyId: null,
            inviteAgencyType: 4,
            contactsOne: '2',
            contactsOnePosition: '4',
            contactsOnePhone: '6',
            contactsTwo: '张三',
            contactsTwoPosition: '5',
            contactsTwoPhone: '7',
            commAddressProvince: '140000',
            commAddressCity: '140200',
            commAddressArea: '140202',
            organizationType: 5,
            businessAddress: '山西省大同市城区山西省大同市城区8',
            contractSigningTime: 1582248638000,
            contractEndTime: 1582248638000,
            contractFile:
                '[{"name":"1P4020F057-35O-0.jpg","url":"data/2998778B451649B88E218AFE9172E967.jpg"}]',
            createTime: '2020-02-14 17:31:43',
            updateTime: '2020-02-27 14:50:16',
            certificationTime: null
        },
        {
            id: '3',
            name: '测试_知识产权局',
            abbreviation: '测试_知识产权局',
            nature: '3',
            type: '38',
            authStatus: 2,
            showStatus: 1,
            inviteAgencyId: null,
            inviteAgencyType: 4,
            contactsOne: '2',
            contactsOnePosition: '4',
            contactsOnePhone: '6',
            contactsTwo: '张三',
            contactsTwoPosition: '5',
            contactsTwoPhone: '7',
            commAddressProvince: '140000',
            commAddressCity: '140200',
            commAddressArea: '140202',
            organizationType: 5,
            businessAddress: '山西省大同市城区8',
            contractSigningTime: 1583495025000,
            contractEndTime: 1583495025000,
            contractFile:
                '[{"name":"1P4020F057-35O-0.jpg","url":"data/2998778B451649B88E218AFE9172E967.jpg"}]',
            createTime: '2020-02-14 17:31:43',
            updateTime: '2020-03-06 19:43:45',
            certificationTime: null
        },
        {
            id: '2',
            name: '测试_知识产权中心2333333',
            abbreviation: '3234234234',
            nature: '1',
            type: '6',
            authStatus: 4,
            showStatus: 1,
            inviteAgencyId: null,
            inviteAgencyType: null,
            contactsOne: '王五',
            contactsOnePosition: '1',
            contactsOnePhone: '3',
            contactsTwo: '99999',
            contactsTwoPosition: '2',
            contactsTwoPhone: '4',
            commAddressProvince: '140000',
            commAddressCity: '140300',
            commAddressArea: '140311',
            organizationType: 6,
            businessAddress: '山西省阳泉市郊区山西省阳泉市郊区5',
            contractSigningTime: 1583287993000,
            contractEndTime: 1583287993000,
            contractFile:
                '[{"name":"1P4020F057-35O-0.jpg","url":"data/0A52443AA08E4D029E308F927D3BEA32.jpg"}]',
            createTime: '2020-02-14 17:46:35',
            updateTime: '2020-03-04 10:13:13',
            certificationTime: null
        },
        {
            id: '1',
            name: '测试_知识产权中心',
            abbreviation: '1',
            nature: '11',
            type: '5',
            authStatus: 2,
            showStatus: 1,
            inviteAgencyId: null,
            inviteAgencyType: null,
            contactsOne: null,
            contactsOnePosition: null,
            contactsOnePhone: null,
            contactsTwo: 'aaasd',
            contactsTwoPosition: null,
            contactsTwoPhone: null,
            commAddressProvince: null,
            commAddressCity: null,
            commAddressArea: null,
            organizationType: 6,
            businessAddress: null,
            contractSigningTime: 1583287989000,
            contractEndTime: 1583287989000,
            contractFile: null,
            createTime: '2020-02-14 17:46:35',
            updateTime: '2020-03-04 10:13:09',
            certificationTime: null
        }
    ],
    pageNum: 2,
    pageSize: 10,
    size: 10,
    startRow: 0,
    endRow: 0,
    pages: 2,
    prePage: 0,
    nextPage: 0,
    isFirstPage: false,
    isLastPage: false,
    hasPreviousPage: false,
    hasNextPage: false,
    navigatePages: 0,
    navigatepageNums: null,
    navigateFirstPage: 0,
    navigateLastPage: 0,
    firstPage: 0,
    lastPage: 0
}

export default {
    name: 'c',
    data() {
        return {
            columns,
            data: []
        }
    },
    mounted() {
        setTimeout(() => {
            this.data = d
        }, 1000)
    },
    methods: {
        handle(page) {
            console.log(page)
            setTimeout(() => {
                if (page.current === 2) {
                    this.data = d2
                } else {
                    this.data = d
                }
            }, 1000)
        },
        handleEdit(d) {
            console.log(d)
        }
    }
}
</script>
